Merge vcpu phase 2
Signed-off-by Anthony Xu <Anthony.xu@intel.com>
1. Add r4,r5,r6,r7,eml_unat,rfi_pfs six members at the end of pt_regs,
thus VMM for non-VT domain doesn't need to save/restore SWITCH_STACK
just in case VMM may need modify guest r4,r5,r6,r7 value, eml_unat is saved
in case VMM may need modify guest unat, rfi_pfs is used to emulate guest rfi
instruction for VT domain, and is used as dummy member for alignment of F6,
F7 etc. in pt_regs for non-VT domain. And add code to save/restore r4,r5,r6,
r7,eml_unat in minstate.h and entry.s for non-VT domain. and remove code to
save/restore SWITCH_STACK in ivt.S for non-VT domain.
2. Originally guest banked registers of VT domain are saved directly in VPD. Now
Guest banked registers of VT domain are saved to pt_regs at the entry of VMM,
just for consistence with non-VT domain, vmx_vcpu_bsw0 and vmx_vcpu_bsw1 are
rewriten for accomodating this change.
3. After above changes, all guest registers and nat bits are saved at same place
both for VTI domain and for non-VTI domain, so vcpu_get/set_gr and rse_get/set_gr
are merged, and all these functions can handle guest nats.
4. Merged vcpu_bsw0 and vcpu_bsw1, Now VMM used vgr[16],vbgr[16],vnat,vbnat in mapped_regs_t
struct (is also vpd) to emuate guest banking switch operation.
5. Removed some CONFIG_VTIs and cleaned up some unused structure members and codes.
Note: Credit accidentally omitted from merge vcpu phase 1, included here:
This patch is based on ver 6723. And definitely I can boot dom0 with this patch.
Following things are done in this patch.
1. Merge structure pt_reg.
2. Though vcpu_info structure has been merged, non-vt domain used pointer
vcpu->vcpu_info->arch.privregs, and vt domain used pointer
vcpu->arch.arch_vmx.vpd, the value of these two pointers are different,
that means vt and non-vt domain still use different privileged registers
pages, in this case, we can't merge vcpu.c, so I merged these two pointer,
and put it at vcpu->arch.privregs. vcpu->vcpu_info->arch.privregs and
vcpu->arch.arch_vmx.vpd will not exist. Why put it at vcpu->arch.privregs?
1. There will be one less pointer unreferenced when accessing this
privileged registers page.
2. vcpu->vcpu_info can be accessed by guest, but guest can't access
privileged registers page through this address, guest can access
this privileged page only through another special mapping. So there
is no need to expose this pointer to guest by putting it in
vcpu->vcpu_info structure. All accesses to this page is through
VCPU(vcpu,y) macro,
3. Merged following functions.
Vcpu_set/get_(interruption control registers from cr16 to cr25),
corresponding functions vmx_vcpu_set/get_*** will not exist.
Vcpu->arch.arch_vmx.in_service[4] will not exist, we will all use
vcpu->arch.insvc[4]
4. Cleaned up some unused structure members and codes.
Signed-off-by Anthony Xu <Anthony.xu@intel.com>
30 files changed: